import request from '@/utils/request'
// 查询图表解说记录
export const GetChartExplanation = (date, page, pageSize) => {
  return request({
    url: '/v1/departmentWork/chartExplanation/',
    method: 'get',
    params: { date, page, page_size: pageSize },
  })
}

// 管理员删除图表解读
export const DeleteChartExplanation = (rid) => {
  return request({
    url: '/v1/departmentWork/chartExplanation/',
    method: 'delete',
    params: { rid },
  })
}

// 查询记录评级
export const GetLevelChartExplanation = (date, level, page, pageSize) => {
  return request({
    url: '/v1/departmentWork/chartExplanation/level/',
    method: 'get',
    params: { date, level, page, page_size: pageSize },
  })
}

// 评级图表解读
export const LevelChartExplanation = (data) => {
  return request({
    url: '/v1/departmentWork/chartExplanation/level/',
    method: 'put',
    data,
  })
}

// --------------------------------------------------------------------

// 增加解读记录
export const CreateMyChartExplanation = (data) => {
  return request({
    url: '/v1/departmentWork/chartExplanation/my/',
    method: 'post',
    data,
  })
}

// 查询解读记录
export const GetMyChartExplanation = (date, page, pageSize) => {
  return request({
    url: '/v1/departmentWork/chartExplanation/my/',
    method: 'get',
    params: { date, page, page_size: pageSize },
  })
}

// 用户删除我的图表解读
export const DeleteMyChartExplanation = (rid) => {
  return request({
    url: '/v1/departmentWork/chartExplanation/my/',
    method: 'delete',
    params: { rid },
  })
}

// --------------------------------------------------------------------

// 统计数据
export const StatisticsChartExplanationRecord = (start, end, st) => {
  return request({
    url: '/v1/departmentWork/chartExplanation/statistics/',
    method: 'get',
    params: { start, end, st },
  })
}
